package tech.aistar.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * 本类用来演示: 监听HttpSession对象的场景和销毁
 *
 * 创建时机 - 程序中第一次出现req.getSession
 *
 * @author: success
 * @date: 2021/4/19 8:50 上午
 */
@WebListener
public class HttpSessionListenderAction implements HttpSessionListener {
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        System.out.println("sessionCreated...");
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        System.out.println("destroyed..session");
    }
}
